package cn.tedu.spring.eg3;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;

@Component
public class ShopController {
    private String m;
    public ShopController(){
        System.out.println("1实例化");
    }
@Value("魏来")
    public void setM(String m) {
        this.m = m;
    System.out.println("2赋值");
    }
    @PostConstruct
    public  void a(){
        System.out.println("3初始化");
    }
    @PreDestroy
    public void dis(){
        System.out.println("5销毁阶段");
    }
}
